package com.googlecode.wicketcharts.highcharts.options;

import java.io.Serializable;

import com.google.gson.Gson;
import com.googlecode.wicketcharts.highcharts.gson.GsonFactory;

/**
 * Parent class for Java objects that can be serialized into JSON.
 * 
 * @author Tom Hombergs (tom.hombergs@gmail.com)
 * 
 */
public abstract class JsonObject implements Serializable {

	private static final long serialVersionUID = 1L;

	public String toJson() {
		Gson gson = GsonFactory.createGson();
		return gson.toJson(this);
	}

}
